import request from '@/utils/request'

// 产品列表
export function getProductList(params) {
  return request({
    url: '/getProductList',
    method: 'get',
    params
  })
}

//添加编辑产品
export function createProduct(data) {
  return request({
    url: '/createProduct',
    method: 'post',
    data
  })
}

// 修改件数
export function updateFinishProductNum(data) {
  return request({
    url: '/updateFinishProductNum',
    method: 'post',
    data
  })
}



// 规格列表
export function getSpecificationList(params) {
  return request({
    url: '/getSpecificationList',
    method: 'get',
    params
  })
}

//+规格
export function createSpecification(params) {
  return request({
    url: '/createSpecification',
    method: 'post',
    params
  })
}


//-规格
export function delSpecification(params) {
  return request({
    url: '/delSpecification',
    method: 'post',
    params
  })
}





// 型号列表
export function getModelNumberList(params) {
  return request({
    url: '/getModelNumberList',
    method: 'get',
    params
  })
}


//+1型号
export function createModelNumber(data) {
  return request({
    url: '/createModelNumber',
    method: 'post',
    data
  })
}
// +多
export function batchAddModelNumber(data) {
  return request({
    url: '/batchAddModelNumber',
    method: 'post',
    data
  })
}


export function addModelNumber(data) {
  return request({
    url: '/addModelNumber',
    method: 'post',
    data
  })
}



//-型号
export function delModelNumber(params) {
  return request({
    url: '/delModelNumber',
    method: 'post',
    params
  })
}

// 关联颜色
export function addProductColor(params) {
  return request({
    url: '/addProductColor',
    method: 'post',
    params
  })
}


// get关联的颜色
export function getProductColorList(params) {
  return request({
    url: '/getProductColorList',
    method: 'get',
    params
  })
}

// 移除关联颜色
export function delProductColor(params) {
  return request({
    url: '/delProductColor',
    method: 'post',
    params
  })
}
// get关联颜色
// export function getSpecificationList(params) {
//   return request({
//     url: '/getSpecificationList',
//     method: 'get',
//     params
//   })
// }

// 关联工种
export function addProductJobType(params) {
  return request({
    url: '/addProductJobType',
    method: 'post',
    params
  })
}


// get关联工种
export function getProductJobTypeList(params) {
  return request({
    url: '/getProductJobTypeList',
    method: 'get',
    params
  })
}

export function getProductJobTypeSort(params) {
  return request({
    url: '/getProductJobTypeSort',
    method: 'get',
    params
  })
}


export function setProductJobTypeSort(params) {
  return request({
    url: '/setProductJobTypeSort',
    method: 'post',
    params
  })
}

export function getJobTypePriceBySpecificationId(params) {
  return request({
    url: '/getJobTypePriceBySpecificationId',
    method:'get',
    params
  })
}

export function setJobTypePriceBySpecificationId(params) {
  return request({
    url: '/setJobTypePriceBySpecificationId',
    method: 'post',
    params
  })
}



// 移除关联工种
export function delProductJobType(params) {
  return request({
    url: '/delProductJobType',
    method: 'post',
    params
  })
}



// // 关联规格
// export function createSpecification(params) {
//   return request({
//     url: '/createSpecification',
//     method: 'post',
//     params
//   })
// }


// 移除关联型号
export function delProductModelnumber(params) {
  return request({
    url: '/delProductModelnumber',
    method: 'post',
    params
  })
}



// 工种列表
export function getJobTypeList(params) {
  return request({
    url: '/getJobTypeList',
    method: 'get',
    params
  })
}
//+工种
export function createJobType(params) {
  return request({
    url: '/createJobType',
    method: 'post',
    params
  })
}




//-工种
export function delJobType(params) {
  return request({
    url: '/delJobType',
    method: 'post',
    params
  })
}




// 颜色列表
export function getColorList(params) {
  return request({
    url: '/getColorList',
    method: 'get',
    params
  })
}


// +颜色
export function createColor(params) {
  return request({
    url: '/createColor',
    method: 'post',
    params
  })
}
// -颜色
export function delColor(params) {
  return request({
    url: '/delColor',
    method: 'post',
    params
  })
}



// 客户列表
export function getCustomerList(params) {
  return request({
    url: '/getCustomerList',
    method: 'get',
    params
  })
}




// +客户
export function createCustomer(params) {
  return request({
    url: '/createCustomer',
    method: 'post',
    params
  })
}

// -客户
export function delCustomer(params) {
  return request({
    url: '/delCustomer',
    method: 'post',
    params
  })
}

// 员工列表
export function getEmployeeList(params) {
  return request({
    url: '/getEmployeeList',
    method: 'get',
    params
  })
}
// +员工
export function createEmployee(params) {
  return request({
    url: '/createEmployee',
    method: 'post',
    params
  })
}

// -员工
export function delEmployee(params) {
  return request({
    url: '/delEmployee',
    method: 'post',
    params
  })
}




// 订单列表
export function getOrderList(params) {
  return request({
    url: '/getOrderList',
    method: 'get',
    params
  })
}


// 根据订单id获取子订单列表
export function getOrderChildListByOrderId(params) {
  return request({
    url: '/getOrderChildListByOrderId',
    method: 'get',
    params
  })
}





//获取子订单列表
export function getOrderChildList(params) {
  return request({
    url: '/getOrderChildList',
    method: 'get',
    params
  })
}



//获取审核订单列表
export function getAuditOrderList(params) {
  return request({
    url: '/getAuditOrderList',
    method: 'get',
    params
  })
}



//获取审核订单列表daochu
export function getAuditOrderList_exports(params) {
  return request({
    url: '/getAuditOrderList',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}




// +订单
export function createOrder(data) {
  return request({
    url: '/createOrder',
    method: 'post',
    data
  })
}

// 订单审核
export function auditOrder(data) {
  return request({
    url: '/auditOrder',
    method: 'post',
    data
  })
}

// 指派订单
export function assignOrderChild(data) {
  return request({
    url: '/assignOrderChild',
    method: 'post',
    data
  })
}



// 外包订单
export function epibolyOrderChild(data) {
  return request({
    url: '/epibolyOrderChild',
    method: 'post',
    data
  })
}


// 根据工种ID获取员工列表
export function getUserListByJobTypeId(params) {
  return request({
    url: '/getUserListByJobTypeId',
    method: 'get',
    params
  })
}

// 仓库列表
export function getWarehouseList(params) {
  return request({
    url: '/getWarehouseList',
    method: 'get',
    params
  })
}

// +仓库
export function createWarehouse(data) {
  return request({
    url: '/createWarehouse',
    method: 'post',
    data
  })
}


//-仓库
export function delWarehouse(data) {
  return request({
    url: '/delWarehouse',
    method: 'post',
    data
  })
}



//+货架
export function createGoodsShelf(data) {
  return request({
    url: '/createGoodsShelf',
    method: 'post',
    data
  })
}

//-货架
export function delGoodsShelf(data) {
  return request({
    url: '/delGoodsShelf',
    method: 'post',
    data
  })
}



// 设置子订单状态为【已完成】
// export function setOrderChildStatus(data) {
//   return request({
//     url: '/setOrderChildStatus',
//     method: 'post',
//     data
//   })
// }


// 获取半成品列表
export function getSemiFinishProductList(params) {
  return request({
    url: '/getSemiFinishProductList',
    method: 'get',
    params
  })
}

// 将半成品添加到成品列表
export function addFinishProduct(data) {
  return request({
    url: '/addFinishProduct',
    method: 'post',
    data
  })
}

// 获取成品列表
export function getFinishProductList(params) {
  return request({
    url: '/getFinishProductList',
    method: 'get',
    params
  })
}

export function getFinishProductList_exports(params) {
  return request({
    url: '/getFinishProductList',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}

// 获取可以调货的orderList
export function getStockAllocationList(params) {
  return request({
    url: '/getStockAllocationList',
    method: 'get',
    params
  })
}



// 调货
export function stockAllocation(data) {
  return request({
    url: '/stockAllocation',
    method: 'post',
    data
  })
}

//获取订单审核列表
export function getOrderAuditList(params) {
  return request({
    url: '/getOrderAuditList',
    method: 'get',
    params
  })
}



// 设置订单审核状态
export function setOrderAuditStatus(data) {
  return request({
    url: '/setOrderAuditStatus',
    method: 'post',
    data
  })
}


// 设置为待发货状
export function setDeliveryStatus(data) {
  return request({
    url: '/setDeliveryStatus',
    method: 'post',
    data
  })
}

// // 发货
// export function DeliverGoods(data) {
//   return request({
//     url: '/DeliverGoods',
//     method: 'post',
//     data
//   })
// }



// 备货列表
export function getStockUpList(params) {
  return request({
    url: '/getStockUpList',
    method: 'get',
    params
  })
}

// 备货列表daochu 
export function getStockUpList_exports(params) {
  return request({
    url: '/getStockUpList',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}





// 设置备货状态
export function setStockUpStatus(data) {
  return request({
    url: '/setStockUpStatus',
    method: 'post',
    data
  })
}


export function downloadcode(params) {
  return request({
    url: '/getOrderList',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}

// 获取供应商列表
export function getSupplierList(params) {
  return request({
    url: '/getSupplierList',
    method: 'get',
    params
  })
}

// 创建编辑供应商
export function createSupplier(data) {
  return request({
    url: '/createSupplier',
    method: 'post',
    data
  })
}
// -供应商
export function delSupplier(data) {
  return request({
    url: '/delSupplier',
    method: 'post',
    data
  })
}


// 获取材料分类列
export function getMaterialTypeList(params) {
  return request({
    url: '/getMaterialTypeList',
    method: 'get',
    params
  })
}
// +材料
export function createMaterialType(data) {
  return request({
    url: '/createMaterialType',
    method: 'post',
    data
  })
}

// -材料
export function delMaterialType(data) {
  return request({
    url: '/delMaterialType',
    method: 'post',
    data
  })
}


// 获取材料规格列表
export function getMaterialSpecificationList(params) {
  return request({
    url: '/getMaterialSpecificationList',
    method: 'get',
    params
  })
}
// +材料规格
export function createMaterialSpecification(data) {
  return request({
    url: '/createMaterialSpecification',
    method: 'post',
    data
  })
}

// -材料规格
export function delMaterialSpecification(data) {
  return request({
    url: '/delMaterialSpecification',
    method: 'post',
    data
  })
}


// 获取材料
export function getMaterialList(params) {
  return request({
    url: '/getMaterialList',
    method: 'get',
    params
  })
}
// +材料
export function createMaterial(data) {
  return request({
    url: '/createMaterial',
    method: 'post',
    data
  })
}

// -材料
export function delMaterial(data) {
  return request({
    url: '/delMaterial',
    method: 'post',
    data
  })
}

// 获取出入库单记录列
export function getWarehouseOrderList(params) {
  return request({
    url: '/getWarehouseOrderList',
    method: 'get',
    params
  })
}
// +出入库单记录列
export function createWarehouseOrder(data) {
  return request({
    url: '/createWarehouseOrder',
    method: 'post',
    data
  })
}


// 获取派单顺序列表
export function getDispatchOrderList(params) {
  return request({
    url: '/getDispatchOrderList',
    method: 'get',
    params
  })
}



// 设置派单顺序
export function setDispatchOrder(data) {
  return request({
    url: '/setDispatchOrder',
    method: 'post',
    data
  })
}

//获取参与生产工种下拉
export function getJobTypeListDropDown(params) {
  return request({
    url: '/getJobTypeListDropDown',
    method: 'get',
    params
  })
}

// 获取当前产品所属型号列表
export function getModelNumberByProduct(params) {
  return request({
    url: '/getModelNumberByProduct',
    method: 'get',
    params
  })
}

// 抽号机get设置
export function getInvoicesList(params) {
  return request({
    url: '/getInvoicesList',
    method: 'get',
    params
  })
}

// 抽号机设置
export function setInvoicesSort(data) {
  return request({
    url: '/setInvoicesSort',
    method: 'post',
    data
  })
}


// 抽号机设置字段
export function setInvoicesValue(data) {
  return request({
    url: '/setInvoicesValue',
    method: 'post',
    data
  })
}

// 流水号设置
export function getRuleSerialNumber(params) {
  return request({
    url: '/getRuleSerialNumber',
    method: 'get',
    params
  })
}

export function setRuleSerialNumber(data) {
  return request({
    url: '/setRuleSerialNumber',
    method: 'post',
    data
  })
}




// 获取抽号机管理卡列表
export function getManagementCardList(params) {
  return request({
    url: '/getManagementCardList',
    method: 'get',
    params
  })
}


export function createManagementCard(data) {
  return request({
    url: '/createManagementCard',
    method: 'post',
    data
  })
}


export function delManagementCard(data) {
  return request({
    url: '/delManagementCard',
    method: 'post',
    data
  })
}



//获取要显示字段
export function getOrderFieldLogList(params) {
  return request({
    url: '/getOrderFieldLogList',
    method: 'get',
    params
  })
}

//修改要显示字段
export function setOrderFieldLogList(data) {
  return request({
    url: '/setOrderFieldLogList',
    method: 'post',
    data
  })
}




///获取员工工资列表
export function getSalaryList(params) {
  return request({
    url: '/getSalaryList',
    method: 'get',
    params
  })
}

export function getSalaryList_exports(params) {
  return request({
    url: '/getSalaryList',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}




export function getSalaryInfo_exports(params) {
  return request({
    url: '/getSalaryInfo',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}

export function getModelNumberUser(params) {
  return request({
    url: '/getModelNumberUser',
    method: 'get',
    params
  })
}

//获取员工工资详情
export function getSalaryInfo(params) {
  return request({
    url: '/getSalaryInfo',
    method: 'get',
    params
  })
}

//修改员工工资
export function changeSalary(data) {
  return request({
    url: '/changeSalary',
    method: 'post',
    data
  })
}



//获取流水号
export function automaticGenerationSerialNumber(params) {
  return request({
    url: '/automaticGenerationSerialNumber',
    method: 'get',
    params
  })
}


export function getCardId(params) {
  return request({
    url: 'http://127.0.0.1:9191/getCardId',
    method: 'get',
    params
  })
}


export function topUp(data) {
  return request({
    url: '/topUp',
    method: 'post',
    data
  })
}




//客户金额明细
export function getBalanceHistoryList(params) {
  return request({
    url: '/getBalanceHistoryList',
    method: 'get',
    params
  })
}

export function getBalanceHistoryList_exports(params) {
  return request({
    url: '/getBalanceHistoryList',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}






// 添加到打印列表
export function addOrderPrint(data) {
  return request({
    url: '/addOrderPrint',
    method: 'post',
    data
  })
}


//获取工单打印列表
export function getOrderPrintList(params) {
  return request({
    url: '/getOrderPrintList',
    method: 'get',
    params
  })
}



// 发货
export function DeliverGoods(data) {
  return request({
    url: '/DeliverGoods',
    method: 'post',
    data
  })
}

export function deductMoney(data) {
  return request({
    url: '/deductMoney',
    method: 'post',
    data
  })
}

export function addSpecification(data) {
  return request({
    url: '/addSpecification',
    method: 'post',
    data
  })
}

export function deleteSpecification(data) {
  return request({
    url: '/deleteSpecification',
    method: 'post',
    data
  })
}


// 审核删除
export function delOrder(data) {
  return request({
    url: '/delOrder',
    method: 'post',
    data
  })
}


// 成品删除
export function delFinishProduct(data) {
  return request({
    url: '/delFinishProduct',
    method: 'post',
    data
  })
}

// 自动生成订单号
export function automaticGenerationOrderNumber(params) {
  return request({
    url: '/automaticGenerationOrderNumber',
    method: 'get',
    params
  })
}


// 领取顶单
export function drawOrderChildByEmployeeCardNumnber(data) {
  return request({
    url: '/drawOrderChildByEmployeeCardNumnber',
    method: 'post',
    data
  })
}

// 获取调货记录
export function getStockAllocationLog(params) {
  return request({
    url: '/getStockAllocationLog',
    method: 'get',
    params
  })
}

// 删打印
export function delOrderPrint(data) {
  return request({
    url: '/delOrderPrint',
    method: 'post',
    data
  })
}

// 获取考勤记录
export function getAppendanceLogList(params) {
  return request({
    url: '/getAppendanceLogList',
    method: 'get',
    params
  })
}

//获取考勤设置列表
export function getAppendanceList(params) {
  return request({
    url: '/getAppendanceList',
    method: 'get',
    params
  })
}


//设置考勤时间
export function updateAppendance(data) {
  return request({
    url: '/updateAppendance',
    method: 'post',
    data
  })
}


// 获取短信设置
export function getNoteList(params) {
  return request({
    url: '/getNoteList',
    method: 'get',
    params
  })
}
// 短信设置
export function createNote(data) {
  return request({
    url: '/createNote',
    method: 'post',
    data
  })
}




// 获取盘点列表
export function getCheckLogList(params) {
  return request({
    url: '/getCheckLogList',
    method: 'get',
    params
  })
}


// 获取盘点列表
export function getCheckLogList_exports(params) {
  return request({
    url: '/getCheckLogList',
    method: 'get',
    responseType:'blob',
    headers: {
      'Content-Type': 'application/octet-stream'
    },
    params
  })
}


// 批量发货
export function batchSettingYifahuo(data) {
  return request({
    url: '/batchSettingYifahuo',
    method: 'post',
    data
  })
}


// 取消代发货
export function cancelDelivery(data) {
  return request({
    url: '/cancelDelivery',
    method: 'post',
    data
  })
}

// 工价同步
export function batchSetJobTypePrice(data) {
  return request({
    url: '/batchSetJobTypePrice',
    method: 'post',
    data
  })
}

//规格修改
export function updateSpecification(data) {
  return request({
    url: '/updateSpecification',
    method: 'post',
    data
  })
}


//获取相同工种的产品
export function getSameJobTypeListProductList(params) {
  return request({
    url: '/getSameJobTypeListProductList',
    method: 'get',
    params
  })
}

//获取模型列表
export function getModelList(params) {
  return request({
    url: '/getModelList',
    method: 'get',
    params
  })
}

//获取模型字段列表
export function getModelFieldList(params) {
  return request({
    url: '/getModelFieldList',
    method: 'get',
    params
  })
}

//新增模型
export function addModel(data) {
  return request({
    url: '/addModel',
    method: 'post',
    data
  })
}
//新增字段
export function addModelField(data) {
  return request({
    url: '/addModelField',
    method: 'post',
    data
  })
}

// 模型字段是否显示
export function updateDefauleFieldShow(data) {
  return request({
    url: '/updateDefauleFieldShow',
    method: 'post',
    data
  })
}

// 删除字段
export function delModelField(data) {
  return request({
    url: '/delModelField',
    method: 'post',
    data
  })
}


// 获取产品对应的模型
export function getProductFieldList(params) {
  return request({
    url: '/getProductFieldList',
    method: 'get',
    params
  })
}

// 补考勤
export function supplementAppendanceLog(data) {
  return request({
    url: '/supplementAppendanceLog',
    method: 'post',
    data
  })
}

//修改成品列表仓库
export function alterFinishProductWarehouse(data) {
  return request({
    url: '/alterFinishProductWarehouse',
    method: 'post',
    data
  })
}


// 仓库分类
export function getWarehouseTypeList(params) {
  return request({
    url: '/getWarehouseTypeList',
    method: 'get',
    params
  })
}

//产品下的半成品
export function getSemiListByProductId(params) {
  return request({
    url: '/getSemiListByProductId',
    method: 'get',
    params
  })
}


//修改型号
export function alertModelNumber(data) {
  return request({
    url: '/alertModelNumber',
    method: 'post',
    data
  })
}


//根据模型获取产品
export function getProductInfoByModelNumberId(params) {
  return request({
    url: '/getProductInfoByModelNumberId',
    method: 'get',
    params
  })
}

// 根据产品获取型号
export function getModelNumberListByProduct(params) {
  return request({
    url: '/getModelNumberListByProduct',
    method: 'get',
    params
  })
}

//根据型号id获取颜色id 
export function getColorByModelNumberId(params) {
  return request({
    url: '/getColorByModelNumberId',
    method: 'get',
    params
  })
}


// 审核修改订单
export function alertOrder(data) {
  return request({
    url: '/alertOrder',
    method: 'post',
    data
  })
}


// 完成指定员工指定工序订单
export function setOrderChildStatus(data) {
  return request({
    url: '/setOrderChildStatus',
    method: 'post',
    data
  })
}


//获取库存
export function getInventoryCount(params) {
  return request({
    url: '/getInventoryCount',
    method: 'get',
    params
  })
}


//半成品-产品-型号
export function getSemiFinishProductInfo(params) {
  return request({
    url: '/getSemiFinishProductInfo',
    method: 'get',
    params
  })
}


// 查询退货
export function getDeliveredOrderList(params) {
  return request({
    url: '/getDeliveredOrderList',
    method: 'get',
    params
  })
}



// 新增退货
export function addReturnedGoods(data) {
  return request({
    url: '/addReturnedGoods',
    method: 'post',
    data
  })
}

// 退货列表
export function getReturnedGoodsList(params) {
  return request({
    url: '/getReturnedGoodsList',
    method: 'get',
    params
  })
}



// 获取维修列表
export function getMaintainList(params) {
  return request({
    url: '/getMaintainList',
    method: 'get',
    params
  })
}

//还货 
export function exchangeGoods(data) {
  return request({
    url: '/exchangeGoods',
    method: 'post',
    data
  })
}


//换货列标
export function getExchangeGoodsList(params) {
  return request({
    url: '/getExchangeGoodsList',
    method: 'get',
    params
  })
}

//清空卡号
export function clearEmployeeCardId(data) {
  return request({
    url: '/clearEmployeeCardId',
    method: 'post',
    data
  })
}





// export function getSemiFinishProductInfo(params) {
//   return request({
//     url: '/getSemiFinishProductInfo',
//     method: 'get',
//     params
//   })
// }


export function finishAddSemi(data) {
  return request({
    url: '/finishAddSemi',
    method: 'post',
    data
  })
}

//关联工人
export function setModelNumberUser(data) {
  return request({
    url: '/setModelNumberUser',
    method: 'post',
    data
  })
}


export function getProductUnitPrice(params) {
  return request({
    url: '/getProductUnitPrice',
    method: 'get',
    params
  })
}
export function updateProductUnitPrice(data) {
  return request({
    url: '/updateProductUnitPrice',
    method: 'post',
    data
  })
}

export function getYuanGongList(params) {
  return request({
    url: '/getYuanGongList',
    method: 'get',
    params
  })
}


export function createWarehouseLocation(data) {
  return request({
    url: '/createWarehouseLocation',
    method: 'post',
    data
  })
}


export function getSemiFinishProductInfoList(params) {
  return request({
    url: '/getSemiFinishProductInfoList',
    method: 'get',
    params
  })
}

export function delSemiFinishProduct(data) {
  return request({
    url: '/delSemiFinishProduct',
    method: 'post',
    data
  })
}

export function setModelNumberSpecification(data) {
  return request({
    url: '/setModelNumberSpecification',
    method: 'post',
    data
  })
}

export function updateOrderChildEmployeeUserId(data) {
  return request({
    url: '/updateOrderChildEmployeeUserId',
    method: 'post',
    data
  })
}

